package com.java8feature.java8action.chapter14;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Description:
 * @Author: yangzhiwei
 * @Date: 2021/6/11 16:27
 */
public class CustomerStream {

//    public static Stream<Integer> primes(int n) {
//        return Stream.iterate(2, i -> i + 1)
//                .filter()
//                .limit(n)
//    }
//
//    public static boolean isPrime(int )

    public static void main(String[] args) {
        String[] arrayOfWords = {"Goodbye", "World"};
        Stream<String> streamOfWorlds = Arrays.stream(arrayOfWords);

        List<String> res = streamOfWorlds.map(word -> word.split(""))
                .flatMap(Arrays::stream)
                .distinct()
                .collect(Collectors.toList());
        System.out.println(res);
    }
}
